home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / perl5 / Dpkg / Exit.pm < prev    next >
Encoding:
Perl POD Document  |  2012-09-17  |  975 b   |  35 lines

  1. # Copyright ┬⌐ 2002 Adam Heath <doogie@debian.org>
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  15.  
  16. package Dpkg::Exit;
  17.  
  18. use strict;
  19. use warnings;
  20.  
  21. our $VERSION = "1.00";
  22.  
  23. our @handlers = ();
  24. sub exit_handler {
  25.     &$_() foreach (reverse @handlers);
  26.     exit(127);
  27. }
  28.  
  29. $SIG{'INT'} = \&exit_handler;
  30. $SIG{'HUP'} = \&exit_handler;
  31. $SIG{'QUIT'} = \&exit_handler;
  32.  
  33. # vim: set et sw=4 ts=8
  34. 1;
  35.